package cn.edu.scau.cmi.luochenghao.chapter04;

public class GreatestN {
	public static void main(String[] args) {
		int total = 0, n = 1;
		for (int x = 1;; n++) {
			x *= n;
			total += x;
			if (total > 9876)
				break;
		}
		n--;
		System.out.print("最大的n是：");
		System.out.println(n);
	}
}
